package cn.lhx.blog.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
 * 后台管理过滤器
 * @author lhx
 *
 */
public class AdminServlet extends HttpServlet{

	protected void service(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		if(req.getSession().getAttribute("adminIsLogin")!=null){
			req.getRequestDispatcher("admin.do?method=initAdmin").forward(req,resp);
		}else{
			resp.sendRedirect("index.jsp");
			
		}
		
//			req.getRequestDispatcher("admin.do?method=initAdmin").forward(req,resp);

	}

}
